/**
 * Created by chenyong on 2015/7/16.
 */

var passport = require('passport');
var WeiboStrategy = require('passport-weibo').Strategy;

exports.setup = function (config){
    passport.use(new WeiboStrategy({
            clientID: config.weibo.clientID,
            clientSecret: config.weibo.clientSecret,
            callbackURL: config.weibo.callbackURL
        },
        function(accessToken, refreshToken, profile, done) {
            //将用户信息写入数据库
            return done(null, profile);
        }
    ));

};